﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Acoris.Document
{
    #region ResourceIDGenerator Defination

    static class RandomResourceIdGenerator
    {
        // 随机资源ID生成
        // 目前使用的随机化方法是日期作为种子
        static long seed = DateTime.Now.Ticks;
        static Random _rand = new Random((int)seed);
        static string _word = "123456789abcdefghijklmnopqrstuvwxyz";

        internal static string Gen()
        {
            StringBuilder builder = new StringBuilder();
            for (int i = 0; i < 32; i++) {
                var num = _rand.Next(0,_word.Length-1);
                var ch = _word[num];
                builder.Append(ch);
            }
            return builder.ToString();
        }
    }

    #endregion
}
